package com.gmall.coupon.feign;

import com.gmall.common.result.Result;
import com.gmall.coupon.feign.impl.CouponApiFeignClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@FeignClient(value = "service-coupon",fallback = CouponApiFeignClientFallback.class)
public interface CouponApiFeignClient {
    @GetMapping("api/coupon/useCoupon/{couponId}/{userId}/{orderId}")
    public Result<String> useCoupon(@PathVariable Long couponId,
                                    @PathVariable Long userId,
                                    @PathVariable Long orderId);

    @GetMapping("api/coupon/unUseCoupon/{orderId}")
    public Result<String> unUseCoupon(@PathVariable Long orderId);
}
